#!/bin/bash -l
#启动数据库和后端服务，若只需重新部署后端服务，则直接运行hfserver.sh即可
DOCKER_CONTAINER=@docker.container@
DOCKER_IMG=@docker.image@
SERVER_PORT=@project.port@

docker stop ${DOCKER_CONTAINER}
docker rm ${DOCKER_CONTAINER}
docker rmi ${DOCKER_IMG}
docker build -t ${DOCKER_IMG} .
#docker run --rm -it -p ${SERVER_PORT}:${SERVER_PORT} -v ${HOST_LOG}:${APP_LOG} --link ${MYSQL_CONTAINER}:${NETWORK} --name ${DOCKER_CONTAINER} ${DOCKER_IMG}
docker run --rm -it -d --tty -p ${SERVER_PORT}:${SERVER_PORT} --name ${DOCKER_CONTAINER} ${DOCKER_IMG}